<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	System.out.print(path);
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	System.out.print(basePath);
%>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>TI - webui</title>
<link rel="stylesheet" href="css/zTreeStyleOld/metro.css">
<script src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.ztree.all-3.5.min.js"
	charset="UTF-8"></script>
<script type="text/javascript" src="js/spin.min.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/ztree-webui.js" charset="UTF-8"></script>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.ztree.exhide-3.5.min.js"></script>
<script type="text/javascript">
	/* function MaxMe(o) {
		if (window.navigator.userAgent.indexOf("Firefox") > -1) {
			o.style.height = o.scrollTop + o.scrollHeight + "px";
		} else {
			if (o.scrollTop > 0)
				o.style.height = o.scrollTop + o.scrollHeight + "px";
		}
	}

	function Init() {
		var textarea = document.getElementById("webui_step");
		if (textarea.addEventListener) { // 非Internet Explorer和Internet Explorer9之后的版本
			textarea.addEventListener("input", OnTextInput, false);
			// Google Chrome 和 Safari
			textarea.addEventListener("textinput", OnTextInput, false);
		}

		if (textarea.attachEvent) { // Internet Explorer 和 Opera
			textarea.attachEvent("onpropertychange", OnTextInput);
		}
	}

	function OnTextInput(evt) {
		o = window.event ? window.event.srcElement : evt.target;
		if (window.navigator.userAgent.indexOf("Firefox") > -1) {
			o.style.height = o.scrollTop + o.scrollHeight + "px";
		} else {
			if (o.scrollTop > 0)
				o.style.height = o.scrollTop + o.scrollHeight + "px";
		}
	}
	window.onload = Init; */
	
	$(document).on("input propertychange", "#webui_step", function (e) {
	       var target = e.target;
	       // 保存初始高度，之后需要重新设置一下初始高度，避免只能增高不能减低。           
	        var dh = $(target).attr('defaultHeight') || 0;
	        if (!dh) {
	            dh = target.clientHeight;
	            $(target).attr('defaultHeight', dh);
	        }

	        target.style.height = dh +'px';
	        var clientHeight = target.clientHeight;
	        var scrollHeight = target.scrollHeight;
	        if (clientHeight !== scrollHeight) { target.style.height = scrollHeight + 10 + "px";
	        }
	    });
	
	/* 
	$.fn.autoHeight = function(){
		
		function autoHeight(elem){
			elem.style.height = 'auto';
			elem.scrollTop = 0; //防抖动
			elem.style.height = elem.scrollHeight + 'px';
		}
		
		this.each(function(){
			autoHeight(this);
			$(this).on('keyup', function(){
				autoHeight(this);
			});
		});

	}
		
		
	$('textarea[autoHeight]').autoHeight(); */
</script>
<style type="text/css">
html {
	height: 100%;
	margin: 0;
}

body {
	height: 100%;
	margin: 0;
}

a:link {
	text-decoration: none;
}

a:visited {
	text-decoration: none;
}

a:hover {
	text-decoration: none;
}

a:active {
	text-decoration: none;
}
</style>
</head>
<body style="padding: 0px">
	<div style="width: 100%; height: 100%">
		<div style="float: left; width: 19%; height: 100%; overflow: auto;">
			<div style="height: 4px"></div>
			<div>
				<span style="margin-left: 8px"><em
					class="glyphicon glyphicon-th-large"></em> 用例管理</span>
			</div>
			<div>
				<ul id="zTree" class="ztree" style="width: 300px; overflow: auto;"></ul>
			</div>
			<h1></h1>
			<h2></h2>
			<h2></h2>
			<!-- <HR
				style="FILTER: progid:DXImageTransform.Microsoft.Glow(color=#987cb9, strength=10)"
				width="100%" color=#987cb9 SIZE=1> -->
		</div>
		<div
			style="float: left; width: 0.1%; height: 100%; background-color: #DCDCDC;"></div>
		<div
			style="float: left; width: 80.9%; height: 100%; padding: 0px; overflow: auto;"
			id="firstDiv">
			<s:form id="webuiForm">
				<div class="row clearfix">
					<div class="col-md-12 column">
						<ul class="breadcrumb" id="pageNavigation"
							style="background-color: #F0F0F0;font-weight:bold;">
							<li><em class="glyphicon glyphicon-home"></em></li>
							<li class="active"><span style="font-weight:bold;">此处展示用例目录和ID</span></li>
						</ul>
					</div>
				</div>
				<div class="row clearfix">
					<div class="col-md-12 column">
						<div class="col-sm-1">
							<span style="font-weight:bold;">用例步骤:</span>
						</div>
						<div class="col-sm-11">
							<!-- <textarea class="form-control" onpropertychange="MaxMe(this)" id="webui_step" name="wc.stepContent"
								oninput="MaxMe(this)" ontextinput="MaxMe(this)" spellcheck="false" placeholder="请输入需要保存的执行步骤说明"
								style="overflow: hidden"></textarea> -->
								
							<textarea rows="3" spellcheck="false" placeholder="请输入需要保存的执行步骤说明" autoHeight="true" class="form-control" id="webui_step" name="wc.stepContent" style="font-weight:bold;overflow: hidden;"></textarea>
						</div>
					</div>
				</div>

				<HR
					style="FILTER: progid:DXImageTransform.Microsoft.Glow(color=#DCDCDC, strength=10)"
					width="100%" color=#DCDCDC SIZE=1>
				<div class="row clearfix">
					<div class="col-md-12 column">
						<div class="col-sm-12">
							<h4>
								<em class="glyphicon glyphicon-subtitles"></em> <span style="font-weight:bold;">脚本详情</span>
							</h4>
							<textarea class="form-control" rows="20" style=";font-weight:bold;"
								placeholder="请输入需要保存的webui执行脚本" name="wc.codeContent" id="webui_content" spellcheck="false"></textarea>
						</div>
					</div>
				</div>
				<HR
					style="FILTER: progid:DXImageTransform.Microsoft.Glow(color=#987cb9, strength=10)"
					width="100%" color=#987cb9 SIZE=1>

				<div class="row clearfix">
					<div class="col-md-12 column">
						<div class="col-md-12 column">
							<div class="input-append">
								<div class="col-sm-1">
									<button class="btn btn-success" type="button" id="webui_save">
										<em class="glyphicon glyphicon-floppy-save"></em> 保存
									</button>
								</div>
								<div class="col-sm-3">
									<select class="form-control" id="driverChoose">
									<option>chrome-46-WINDOWS</option>
									<!-- <option>chrome-46-WIN8</option>
									<option>chrome-46-WIN8_1</option> -->
									<option>chrome-46-MAC</option>
									<option>firefox-41-WINDOWS</option>
									<!-- <option>firefox-41-WIN8</option>
									<option>firefox-41-WIN8_1</option> -->
									<option>firefox-41-MAC</option>
									<option>internet explorer-6-WINDOWS</option>
									<!-- <option>internet explorer-7-WINDOWS</option> -->
									<option>internet explorer-8-WINDOWS</option>
									<!-- <option>internet explorer-9-WINDOWS</option> -->
									<!-- <option>internet explorer-10-WINDOWS</option>
									<option>internet explorer-11-WINDOWS</option>
									<option>internet explorer-6-WIN8</option>
									<option>internet explorer-7-WIN8</option> -->
									<!-- <option>internet explorer-8-WIN8</option> -->
									<!-- <option>internet explorer-9-WIN8</option>
									<option>internet explorer-10-WIN8</option>
									<option>internet explorer-11-WIN8</option>
									<option>internet explorer-6-WIN8_1</option>
									<option>internet explorer-7-WIN8_1</option> -->
									<!-- <option>internet explorer-8-WIN8_1</option> -->
									<!-- <option>internet explorer-9-WIN8_1</option>
									<option>internet explorer-10-WIN8_1</option>
									<option>internet explorer-11-WIN8_1</option> -->
								</select>
								</div>
								<div class="col-sm-1">
									<button class="btn btn-warning" type="button" id="webui_run">
										<em class="glyphicon glyphicon-play"></em> 运行
									</button>
								</div>
								<div class="col-sm-1">
									<button class="btn btn-danger" type="reset" id="webui_reset">
										<em class="glyphicon glyphicon-repeat"></em> 重置
									</button>
								</div>
							</div>
						</div>
					</div>
				</div>
			</s:form>
			<HR
				style="FILTER: progid:DXImageTransform.Microsoft.Glow(color=#987cb9, strength=10)"
				width="100%" color=#987cb9 SIZE=1>

			<!-- 运行结果面板 -->
			<div class="row clearfix">
				<div class="col-md-12 column">
					<div class="col-sm-12">
						<h5>
							<em class="glyphicon glyphicon-subtitles"></em> 运行步骤
						</h5>
						<textarea class="form-control" rows="10" id="webui_result"
							spellcheck="false"></textarea>
					</div>
				</div>
			</div>

			<div class="row clearfix">
				<div class="col-md-12 column">
					<h1></h1>
					<h2></h2>
					<h2></h2>
				</div>
			</div>
		</div>
	</div>
</body>
</html>